import { Patient } from '../hospital/type';

export interface ResponseData {
	code: number;
	message: string;
	ok: boolean;
	data: any;
}

// 提交订单接口返回的数据的ts类型
export interface SubmitOrderResponseData extends ResponseData {
	data: number;
}

// 订单详情数据的ts类型
export interface OrderInfo {
	id: number;
	createTime: string;
	updateTime: string;
	isDeleted: number;
	param: {
		orderStatusString: string;
	};
	userId: number;
	outTradeNo: string;
	hoscode: string;
	hosname: string;
	depcode: string;
	depname: string;
	scheduleId: string;
	title: string;
	reserveDate: string;
	reserveTime: number;
	patientId: number;
	patientName: string;
	patientPhone: string;
	hosRecordId: string;
	number: number;
	fetchTime: string;
	fetchAddress: string;
	amount: number;
	quitTime: string;
	orderStatus: number;
}

export interface OrderInfoResponseData extends ResponseData {
	data: OrderInfo;
}

// 获取二维码接口返回的数据ts类型
export interface PayInfo {
	codeUrl: string;
	orderId: number;
	totalFee: number;
	resultCode: string;
}

export interface PayInfoResponseData extends ResponseData {
	data: PayInfo;
}

export interface UserInfo {
	id: number;
	createTime: string;
	updateTime: string;
	isDeleted: number;
	param: {};
	openid: null;
	nickName: null;
	phone: string;
	name: string;
	certificatesType: string;
	certificatesNo: string;
	certificatesUrl: string;
	authStatus: number;
	status: number;
}

export interface UserInfoResponseData extends ResponseData {
	data: UserInfo;
}

// 代表证件类型的数据ts
export interface CertificatesType {
	id: number;
	createTime: string;
	updateTime: string;
	isDeleted: number;
	param: {};
	parentId: number;
	name: string;
	value: string;
	dictCode: string;
	hasChildren: boolean;
}

export interface CertificatesTypeResponseData extends ResponseData {
	data: CertificatesType[];
}

// 用户认证的携带的参数的ts类型
export interface UserCertationParams {
	certificatesNo: string;
	certificatesType: string;
	certificatesUrl: string;
	name: string;
}

export interface OrderListResponseData extends ResponseData {
	data: {
		records: OrderInfo[];
		total: number;
		size: number;
		current: number;
		orders: [];
		hitCount: boolean;
		searchCount: boolean;
		pages: number;
	};
}

export interface OrderState {
	comment: string;
	status: number;
}

export interface OrderStateResponseData extends ResponseData {
	data: OrderState[];
}

export interface City {
	id: number;
	createTime: string;
	updateTime: string;
	isDeleted: number;
	param: {};
	parentId: number;
	name: string;
	value: string;
	dictCode: null;
	hasChildren: boolean;
}

export interface CityResponseData extends ResponseData {
	data: City[];
}

// 新增/修改就诊人提交的数据
export interface SubmitPatientData {
	id?: number;
	name: string;
	certificatesType: string;
	certificatesNo: string;
	sex: number;
	birthdate: string;
	phone: string;
	isMarry: number;
	isInsure: number;
	addressSelected: string[];
	address: string;
	contactsName: string;
	contactsCertificatesType: string;
	contactsCertificatesNo: string;
	contactsPhone: string;

	provinceCode?: string;
	cityCode?: string;
	districtCode?: string;
	// cardNo: string;
	// createTime: string;
	// isDeleted: number;
	// param: {};
	// status: string;
	// updateTime: string;
	// userId: number;
}

export interface GetPatientByIdResponseData extends ResponseData {
	data: Patient;
}
